home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / ATLK / TN.ATLK.005 < prev    next >
Encoding:
Text File  |  1989-08-21  |  3.2 KB  |  64 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. AppleTalk
  8. #5:    SPCommand Calls and Error $0702
  9.  
  10. Written by:    Mark Day                                             July 1989
  11.  
  12. The system now uses SPCommand calls asynchronously.  Applications that have 
  13. AppleShare volumes mounted under System Software 5.0 and also make SPCommand 
  14. calls themselves should now handle the "Too many ASP calls" error, $0702.
  15. _____________________________________________________________________________
  16.  
  17. AppleShare uses a protocol called AppleTalk Session Protocol (ASP) to maintain 
  18. a connection (session) with all servers that you are logged on to.  All 
  19. commands and data transfer to the server are sent using ASP.
  20.  
  21. The implementation of ASP on the Apple IIGS has a limit of one command 
  22. outstanding (waiting to complete) per session.  This means that if one command 
  23. has been sent, its reply must be received before you can send the next 
  24. command.  Remember, the SPCommand call is used to send commands over a 
  25. session.  If you try to issue an SPCommand before another (asynchronous) 
  26. SPCommand on the same session has completed, your call will return with a "Too 
  27. many ASP calls" error, $0702.
  28.  
  29. Before System Software 5.0 on the Apple IIGS, no system software made 
  30. asynchronous SPCommand calls, and therefore this error would only occur if the 
  31. developer was making the asynchronous calls.  As of System Software 5.0, the 
  32. AppleShare FST uses asynchronous calls to help prevent the loss of a 
  33. connection with servers and to assist the Finder in dynamically updating 
  34. windows when a change is made to a network volume.  Therefore, this error may 
  35. be returned even though the developer is not making asynchronous calls.
  36.  
  37. The error is easy to handle if you are making synchronous SPCommand calls.  
  38. Simply make the call, and if it completes with error $0702, loop back and make 
  39. the call again until you can do so without error $0702.  This technique forces 
  40. your program to wait until ASP is free again to make the call.
  41.  
  42. If you are making asynchronous SPCommand calls, and you receive the $0702 
  43. error, you might want to install a short (i.e., 1/4 second) timer using the 
  44. InstallTimer call, and make the SPCommand call again when the timer completes.  
  45. Remember, the InstallTimer has to be asynchronous, since you are making it 
  46. from the completion routine of an asynchronous call.
  47.  
  48. The SPWrite call also has a limit of one outstanding call per session.  System 
  49. software does not currently use asynchronous SPWrite calls, but looping until 
  50. ASP returns something other than $0702 would be a good precaution for SPWrite, 
  51. too.
  52.  
  53.  
  54. Note:  When using the AppleShare FST under GS/OS, there is little 
  55.        reason to make SPCommand calls yourself, since most of the calls 
  56.        you can make are available through the FST as normal file system 
  57.        calls or as FST-specific calls.
  58.  
  59.  
  60. Further Reference
  61. _____________________________________________________________________________
  62.     o    AppleShare Programmer's Guide for the Apple IIGS
  63.     o    Inside AppleTalk
  64.     o    System Software 5.0 documentation (APDA)